package com.example.demo.entity;

import lombok.Data;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.impl.*;

@Data
public class User implements IEntity {
    private Long id;
    private String name;
    private String phone;

    public static final Table TES_USER = new Table();

    public static class Table extends TableImpl<Record> {
        public Table() { super(DSL.name("tes_user")); }
        public final TableField<Record, Long> ID = createField(DSL.name("id"), SQLDataType.BIGINT.identity(true), this);
        public final TableField<Record, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR, this);
        public final TableField<Record, String> PHONE = createField(DSL.name("phone"), SQLDataType.VARCHAR, this);
        public UniqueKey<Record> getPrimaryKey() { return Internal.createUniqueKey(this, ID); }
        public Class<Record> getRecordType() { return Record.class; }
    }

    public static class Record extends UpdatableRecordImpl<Record> {
        public Record() { super(TES_USER); }
    }
}
